<script>
$(document).ready(function(){
	  var company_del = $("#company_del").val();
      if(company_del==1){
           alert('此单位下还有发放记录，此单位不可以删除');
      }
})     
</script>
		<div id="center-column">
			<div class="top-bar">
			  <input type="hidden" id="company_del" value="<?php echo $company_del;?>"/>
				<a href="<?php echo  base_url();?>administrator/company_add" class="button">新增</a>
				<h1>Contents</h1>
				<div class="breadcrumbs"><?php echo anchor('main/index','首页');?> / <?php echo anchor('administrator/company','发放单位管理');?></div>
			</div><br />
<!--		  <div class="select-bar">-->
<!--		    <label>-->
<!--		    <input type="text" name="textfield" />-->
<!--		    </label>-->
<!--		    <label>-->
<!--			<input type="submit" name="Submit" value="搜索" />-->
<!--			</label>-->
<!--		  </div>-->
			<div class="table">
				
				
				<table class="listing" cellpadding="0" cellspacing="0">
					<tr>
						<th class="first" width="22">ID</th>
						<th>单位名称</th>
						<th>单位地址</th>
						<th>单位联系人</th>
						<th>单位电话</th>						
						<th class="last">操作</th>
					</tr>
			    <?php foreach($company as $k=>$val):?>		
					<tr>
                        <td><?php echo $start;?></td>                        
                        <td><?php echo $val->name;?></td>
                        <td><?php echo $val->address;?></td>
                        <td><?php echo $val->contacter;?></td>
                        <td><?php echo $val->phone;?></td>
                        <td><?php echo anchor('administrator/company_detail/'.$val->company_id,'查看',array('class'=>'company_detail'));?>&nbsp;&nbsp;|&nbsp;&nbsp;<?php echo anchor('administrator/company_edit/'.$val->company_id,'编辑',array('class'=>'mod_edit'));?>&nbsp;&nbsp;|&nbsp;&nbsp;<?php echo anchor('administrator/company_del/'.$val->company_id,'删除',array('class'=>'mod_edit',"onclick"=>"return confirm('您确定要删除吗？')?true:false;"));?></td>
					</tr>
				<?php $start++;endforeach;?>						
				</table>
				<?php echo $page;?>
			</div>
		</div>
	</div>
	<div id="footer"></div>
</div>


</body>
</html>
